<!--
 * @Author: HeAo
 * @Date: 2021-12-14 14:53:58
 * @LastEditTime: 2021-12-14 15:18:28
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \甘肃农大-2021-12-12\study\day02\5-定位布局.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body {
      height: 5000px;
    }

    .container {
      background-color: cadetblue;
      position: relative;
      height: 1000px;
    }

    .container>div {
      width: 200px;
      height: 200px;
      /* margin: 10px; */
      border: 1px solid #333;
    }

    .box1 {
      background-color: orangered;
      position: relative;
      top: 10px;
      left: 20px;
    }

    .box2 {
      background-color: green;
      position: absolute;
      top: 50px;
      right: 0;
    }

    .box3 {
      background-color: blue;
      position: fixed;
      top: 100px;
      right: 100px;
    }

    .box4 {
      background-color: pink;
      position: sticky;
      top: 0;
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="box4"></div>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
  </div>
</body>

</html>